package br.com.ac.fatureweb.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import br.com.ac.fatureweb.enums.EnumProfileAction;
import br.com.ac.fatureweb.utilitary.Model;

@Entity
@Table(name = "PERFIL_ACAO")
@SequenceGenerator(name = "SEQ_PERFIL_ACAO", sequenceName = "SEQ_PERFIL_ACAO", allocationSize = 1, initialValue = 1)
public class PerfilAcao extends Model {

	private static final long serialVersionUID = -4596232139241734476L;

	@Id
	@GeneratedValue(generator = "SEQ_PERFIL_ACAO", strategy = GenerationType.SEQUENCE)
	@Column(name = "ID")
	private Long id;

	@ManyToOne
	@JoinColumn(name = "ID_PERFIL", referencedColumnName = "ID")
	private Perfil perfil;

	@Enumerated(EnumType.ORDINAL)
	@Column(name = "ACAO")
	private EnumProfileAction acao;

	public PerfilAcao(Perfil perfil, EnumProfileAction acao) {
		super();
		this.perfil = perfil;
		this.acao = acao;
	}

	public PerfilAcao() {
		super();
	}

	public EnumProfileAction getAcao() {
		return acao;
	}

	public void setAcao(EnumProfileAction acao) {
		this.acao = acao;
	}

	public Perfil getPerfil() {
		return perfil;
	}

	public void setPerfil(Perfil perfil) {
		this.perfil = perfil;
	}

	@Override
	public Long getId() {
		return id;
	}

	@Override
	public void setId(Long id) {
		this.id = id;
	}

}
